-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [M3-8682] - Add 'Credit Card Expired' banner #11240
feat: [M3-8682] - Add 'Credit Card Expired' banner #11240
Conversation
60c5fee
to
530b239
Compare
Coverage Report: ✅ |
packages/manager/src/features/GlobalNotifications/CreditCardExpiredBanner.tsx
Show resolved
Hide resolved
</Button> | ||
} | ||
important | ||
preferenceKey={'credit card expired'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: This is probably doesn't matter, but it might be more common practice to make this -
or _
separated rather than
separated
preferenceKey={'credit card expired'} | |
preferenceKey={'credit-card-expired'} |
packages/manager/src/features/GlobalNotifications/CreditCardExpiredBanner.tsx
Outdated
Show resolved
Hide resolved
const isExpired = paymentMethods.some((paymentMethod: PaymentMethod) => { | ||
const ccExpiry = | ||
paymentMethod.type === 'credit_card' ? paymentMethod.data.expiry : null; | ||
return ccExpiry && isCreditCardExpired(ccExpiry); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: This might be a slightly cleaner way to represent this:
const isExpired = paymentMethods.some((paymentMethod: PaymentMethod) => { | |
const ccExpiry = | |
paymentMethod.type === 'credit_card' ? paymentMethod.data.expiry : null; | |
return ccExpiry && isCreditCardExpired(ccExpiry); | |
}); | |
const isExpired = paymentMethods.some((paymentMethod) => { | |
if (paymentMethod.type === 'credit_card' && paymentMethod.data.expiry) { | |
return isCreditCardExpired(paymentMethod.data.expiry); | |
} | |
return false; | |
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harsh-akamai see comments. I see in the ticket that it was mentioned
Are we only concerned that the default payment is the expiring card? Correct
which will allow us to use the existing account query and not add a new on on initial load.
also, can you please confirm we don't need to add a display for a card that's expiring soon?
@abailly-akamai the reporter for this ticket mentioned that expiring soon is not the scope of this ticket. |
Cloud Manager UI test results🎉 445 passing tests on test run #5 ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the changes - this looks good 👍
Description 📝
Add a Credit Card Expired banner for accounts with expired credit cards
Changes 🔄
Preview 📷
How to test 🧪
Verification steps
As an Author I have considered 🤔
Check all that apply